import { defineStore } from 'pinia'

export const useAdminStore = defineStore('admin-store', {
  state() {
    return {
      // adminname 初始化时 从 localstorage 里取
      // localStorage.getItem('不存在的key') 返回 null
      adminname: localStorage.getItem('adminname') || ''
    }
  },
  getters: {

  },
  actions: {
    setAdminname(adminname) {
      this.adminname = adminname
    }
  }
})